Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router): pass fields to indicate if the customer address details to be connector from wallets #5210

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Jul 4, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Currently there are two fields which indicate if the customer address needs to be collected form the wallets like apple pay or google pay. And those fields are collect_shipping_details_from_wallet_connector and collect_billing_details_from_wallet_connector, and the same fields needs to be sent to sdk so that they can make the required decisions based on it.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

-> Create stripe mca
-> For the specific business profile set the below fields as ture

curl --location 'http://localhost:8080/account/merchant_1720165673/business_profile/pro_6Rcn7QpBhEJ1M76tiD4w' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: admin' \
--data '{
    "collect_shipping_details_from_wallet_connector": false,
    "collect_billing_details_from_wallet_connector": false
}'

-> Create a payment with confirm false

{
  "amount": 10000,
  "currency": "USD",
  "capture_method": "automatic",
  "authentication_type": "no_three_ds",
  "confirm": false,
  "customer_id": "aaa"
}

-> Make session call

curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_05af5b5c33c54c33a8b11c3e77b99cc8' \
--data '{
    "payment_id": "pay_xmrt6KKS0Vvye7OO1sIn",
    "wallets": [],
    "client_secret": "pay_xmrt6KKS0Vvye7OO1sIn_secret_8WAX2eYNDT4y5QfWrjL9"
}'

Both shipping and billing will be false in the apple pay and google pay session token
image

-> Do merchant payment method list

curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_xmrt6KKS0Vvye7OO1sIn_secret_8WAX2eYNDT4y5QfWrjL9' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_05af5b5c33c54c33a8b11c3e77b99cc8'
image

-> Now set the fields in the business profile with the below curl

curl --location 'http://localhost:8080/account/merchant_1720167317/business_profile/pro_VPeQOAs890a2r3IrsqCW' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
    "collect_shipping_details_from_wallet_connector": true,
    "collect_billing_details_from_wallet_connector": true
}'
image

-> Create a payment with confirm false
-> Do a session call and the apple pay and the google pay should contain the billing and shipping fields
image

-> Now make payment methods list
image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@ShankarSinghC ShankarSinghC added A-core Area: Core flows A-payment-methods Area: Payment Methods A-payments Area: payments labels Jul 4, 2024
@ShankarSinghC ShankarSinghC self-assigned this Jul 4, 2024
@ShankarSinghC ShankarSinghC requested review from a team as code owners July 4, 2024 12:17
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jul 4, 2024
@preetamrevankar preetamrevankar added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit c642d9d Jul 5, 2024
10 of 11 checks passed
@preetamrevankar preetamrevankar deleted the pm_list/collect_details_from_wallet branch July 5, 2024 11:17
pixincreate added a commit that referenced this pull request Jul 8, 2024
…ify-cypress

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.07.08.0
  fix(connector): [adyen] remove browser info for mit and [paypal] add refund key in headers (#5225)
  chore(version): 2024.07.06.0
  feat(router): Pass the shipping email whenever the billing details are included in the session token response (#5228)
  fix(cypress): fix metadata missing while creating connector if not in auth (#5215)
  refactor: fix unit and documentation tests (#4754)
  feat(events): add hashed customer_email and feature_metadata (#5220)
  feat(events): Add payment metadata to hyperswitch-payment-intent-events (#5170)
  fix(analytics): using HashSet to represent the returned metrics (#5179)
  feat(core): billing_details inclusion in Payment Intent (#5090)
  feat(router): pass fields to indicate if the customer address details to be connector from wallets (#5210)
  fix(refunds): Add aliases on refund status for backwards compatibility (#5216)
  Feat(connector): [BRAINTREE] Implement Card Mandates (#5204)
Narayanbhat166 pushed a commit that referenced this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows A-payment-methods Area: Payment Methods A-payments Area: payments M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pass fields to indicate if the customer address details to be connector from wallets
4 participants